package leecode

import "strconv"

func getDecimalValue(head *ListNode) int {
	var result string
	for head != nil {
		result += strconv.Itoa(head.Val)
		head = head.Next
	}
	//将二进制数转化为十进制
	parseInt, _ := strconv.ParseInt(result, 2, 64)
	return int(parseInt)
}
